//
// Created by xili on 2024/9/26 10:02.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int differenceOfSum(vector<int> &nums) {
        int ans = 0;
        for (int x: nums) {
            ans += x; // 累加元素和
            while (x) {
                ans -= x % 10; // 减去数位和
                x /= 10;
            }
        }
        return ans;
    }
};